package cn.lili.modules.member.entity.dto;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 用户编辑DTO
 *
 * @author liushuai(liushuai711 @ gmail.com)
 * @version v4.0
 * @Description:
 * @since 2023/4/24 10:16
 */

@SuperBuilder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserEditBaseDTO {

    private String id;

    @Size(min = 4, max = 20, message = "昵称长度必须在4-20之间")
    private String nickName;
    @Min(value = -1, message = "性别只能为-1,0,1")
    @Max(value = 1, message = "性别只能为-1,0,1")
    private Integer sex;

    @Size(max = 255, message = "头像图片地址长度不能超过255位")
    private String face = "https://feiyu-lshop-test.oss-cn-beijing.aliyuncs.com/default.png";


    @Getter
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "生日")
    private Date birthday;

}
